
package com.csl.jsonpreference.test

import com.csl.jsonpreference.bean.ConfigTYPE
import com.csl.jsonpreference.tag.Configurable
import com.google.gson.Gson
import org.json.JSONObject

/**
 * aqua car 设备本地配置.
 */
@Configurable(discribe = "wifi串口配置")
class AquaWifiSerialModuleConfig  {

    companion object {
        fun createForJson(json: JSONObject): AquaWifiSerialModuleConfig {
            var config: AquaWifiSerialModuleConfig =
                Gson().fromJson(json.toString(), AquaWifiSerialModuleConfig::class.java)
            return config
        }
    }



    @Configurable(discribe = "串口1", type = ConfigTYPE.OBJECT, index = 0)
    var serial1: WifiSerialConfig = WifiSerialConfig()

    @Configurable(discribe = "串口2", type = ConfigTYPE.OBJECT, index = 0)
    var serial2: WifiSerialConfig = WifiSerialConfig()


}